home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / TRCKR.PAK / MAINFRM.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  130 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14. #include "stdafx.h"
  15. #include "trackapp.h"
  16.  
  17. #include "mainfrm.h"
  18.  
  19. #ifdef _DEBUG
  20. #undef THIS_FILE
  21. static char BASED_CODE THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMainFrame
  26.  
  27. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  28.  
  29. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  30.     //{{AFX_MSG_MAP(CMainFrame)
  31.         // NOTE - the ClassWizard will add and remove mapping macros here.
  32.         //    DO NOT EDIT what you see in these blocks of generated code !
  33.     ON_WM_CREATE()
  34.     //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // arrays of IDs used to initialize control bars
  39.  
  40. // toolbar buttons - IDs are command buttons
  41. static UINT BASED_CODE buttons[] =
  42. {
  43.     // same order as in the bitmap 'toolbar.bmp'
  44.     ID_FILE_NEW,
  45.     ID_FILE_OPEN,
  46.     ID_FILE_SAVE,
  47.         ID_SEPARATOR,
  48.     ID_EDIT_CUT,
  49.     ID_EDIT_COPY,
  50.     ID_EDIT_PASTE,
  51.         ID_SEPARATOR,
  52.     ID_FILE_PRINT,
  53.     ID_APP_ABOUT,
  54.         ID_SEPARATOR,
  55.     ID_EDIT_SOLIDLINE,
  56.     ID_EDIT_DOTTEDLINE,
  57.         ID_SEPARATOR,
  58.     ID_EDIT_HATCHEDBORDER,
  59.     ID_EDIT_HATCHEDINSIDE,
  60.         ID_SEPARATOR,
  61.     ID_EDIT_RESIZEINSIDE,
  62.     ID_EDIT_RESIZEOUTSIDE,
  63.     ID_EDIT_ALLOWINVERT,
  64. };
  65.  
  66. static UINT BASED_CODE indicators[] =
  67. {
  68.     ID_SEPARATOR,           // status line indicator
  69.     ID_INDICATOR_CAPS,
  70.     ID_INDICATOR_NUM,
  71.     ID_INDICATOR_SCRL,
  72. };
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CMainFrame construction/destruction
  76.  
  77. CMainFrame::CMainFrame()
  78. {
  79.     // TODO: add member initialization code here
  80. }
  81.  
  82. CMainFrame::~CMainFrame()
  83. {
  84. }
  85.  
  86. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  87. {
  88.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  89.         return -1;
  90.  
  91.     if (!m_wndToolBar.Create(this) ||
  92.         !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  93.         !m_wndToolBar.SetButtons(buttons,
  94.           sizeof(buttons)/sizeof(UINT)))
  95.     {
  96.         TRACE0("Failed to create toolbar\n");
  97.         return -1;      // fail to create
  98.     }
  99.  
  100.     if (!m_wndStatusBar.Create(this) ||
  101.         !m_wndStatusBar.SetIndicators(indicators,
  102.           sizeof(indicators)/sizeof(UINT)))
  103.     {
  104.         TRACE0("Failed to create status bar\n");
  105.         return -1;      // fail to create
  106.     }
  107.  
  108.     return 0;
  109. }
  110.  
  111.  
  112. /////////////////////////////////////////////////////////////////////////////
  113. // CMainFrame diagnostics
  114.  
  115. #ifdef _DEBUG
  116. void CMainFrame::AssertValid() const
  117. {
  118.     CMDIFrameWnd::AssertValid();
  119. }
  120.  
  121. void CMainFrame::Dump(CDumpContext& dc) const
  122. {
  123.     CMDIFrameWnd::Dump(dc);
  124. }
  125.  
  126. #endif //_DEBUG
  127.  
  128. /////////////////////////////////////////////////////////////////////////////
  129. // CMainFrame message handlers
  130.